$(function () {



    //上传头像
    $(".user_photo").hover(function () {
        $(this).children(".bg,.text").stop().animate({ bottom: "0" }, 100);
    }, function () {
        $(this).children(".bg,.text").stop().animate({ bottom: "-26" }, 100);
    });
    $("#emailChange").click(function () {
        newWidfn("newwid2");
    });


    //简历完整度进度条
    $(".wzd_bg").each(function () {

        var p = $(this).attr("percent");

        var c = parseInt(parseInt(p) / 10);
        if (c > 0) {
            $(this).attr("class", "wzd_bg" + c);
        }
    });
    var baseiconUrl = "/myzhaopin/get_resume_icon.asp";
    var IconUrlList = [];
    function ArrayContain(value) {
        var result = false;
        for (var i = 0; i < IconUrlList.length; i++) {
            if (IconUrlList[i] == value) {
                result = true;
                break;
            }
        }
        return result;
    }



    //修改邮箱
   // $(".alter_mail_wrap").hover(function () {
       // $(this).find(".alter_mail").show();
   // }, function () {
   //     $(this).find(".alter_mail").hide();
    //});

    //修改简历名称
    $(".my_re_info .p_01").hover(function () {
   
        $(this).children(".wrap").show();
    }, function () {
        $(this).children(".wrap").hide();
    });
    $(".my_re_info .wrap a").click(function () {
        dyweTrackEvent('myzhaopin14gb', 'editcvname');
        $(this).parents(".p_01").hide().next(".alter_resume_name").show();
        var name = $(this).parents(".p_01").children("B[class='info_tit']:first").text();

        $(this).parents(".p_01").next(".alter_resume_name").find("input[class='text f_left']").each(function (i) {
            $(this).val(name);

        });
        return false;
    });
    $(".alter_resume_name .btn").click(function () {
        var resumeNumeber;
        var versionNumber;
        var resumename;
        var k1 = $(this).parents();
        var kk = $(this).parent().parent().find("input[class='resumeNumber']").each(function (i) {
            resumeNumeber = $(this).val();
        });
        $(this).parent().parent().find("input[class='versionNumber']").each(function (i) {
            versionNumber = $(this).val();
        });
        $(this).parent().parent().find("input[class='text f_left']").each(function (i) {
            resumename = $(this).val();

        });

        if (resumename != "" && resumename != null && resumename != "undefined") {
            var urlPost = "/Home/SaveResumeName?resumeNumber=" + resumeNumeber + "&versionNumber=" + versionNumber + "&resumeName=" + encodeURI(resumename);

            $.ajax({
                type: "POST",
                url: urlPost,
                cache: false,
                success: function (msg) {
                    // alert(msg.returnString);
                    if (msg.returnNumber == 0) {

                        k1.find(".alter_resume_name").prev(".p_01").children("B[class='info_tit']:first").text(resumename);
                        k1.find(".alter_resume_name").hide().prev(".p_01").show();
                    }
                    else
                        $(this).parents(".alter_resume_name").hide().prev(".p_01").show();
                }
            });
        }
        $(this).parents(".alter_resume_name").hide().prev(".p_01").show();

        //请求成功后执行

        //
    });

    //刷新简历
    $(".my_re_control .ico_refresh").hover(function () {
        $(this).addClass("hover").children(".tips").show();
    }, function () {
        $(this).removeClass("hover").children(".tips").hide();
    });
    $(".my_re_control .ico_refresh a").click(function () {
        dyweTrackEvent('myzhaopin14gb', 'cvrefresh2');
        var lnk = $(this)
        var url = lnk.attr("url");

        $.ajax({
            type: "POST",
            url: url,
            cache: false,
            success: function (date) {

                if (date) {
                    //请求成功后执行
                    lnk.prev(".refresh").show().animate({ top: "-35px", opacity: "1" }, "250", "swing", function () {
                        var _this = this;
                        setTimeout(function () { $(_this).hide().css({ top: "0px", opacity: "0" }); }, 1500);
                    });
                    return false;
                }
                else {

                    alert("刷新失败");

                }
            }
        });


        //
    });

})
